Efficient Directionless Weakest Preconditions
نویسندگان
چکیده
Verification condition (VC) generation is a fundamental part of many program analysis and applications, including proving program correctness, automatic test case generation, and proof carrying code. One might imagine VC applications would use the theoretically most appealing VC generation algorithm. This is often not the case. The most theoretically appealing algorithms are based upon weakest preconditions, and generate VCs at most O(M) for M program statements, however they process statements from last to first. In practice, many application domains choose forward symbolic execution (FSE), which generates predicates O(2 ) in size. FSE is chosen because it builds VCs in execution order, which allows a number of pragmatic optimizations. We reconcile the differences between FSE and WP by proposing a new directionless weakest precondition that can be run in both the forward and backward direction. Our algorithm provides the more attractive O(M) VC generation time and predicate size while allowing VC generation in execution order, which is what makes FSE attractive in practice. Thus, our algorithm can act as a “drop-in” replacement for either algorithm. We provide proofs of correctness, size, and generation time. We also show a correspondence between FSE and WP for deterministic programs, and perhaps surprisingly that they are not equivalent for the full class of GCL programs.
منابع مشابه
Efficient Directionless Weakest Preconditions (CMU-CyLab-10-002)
Verification condition (VC) generation is a fundamental part of many program analysis and applications, including proving program correctness, automatic test case generation, and proof carrying code. One might imagine VC applications would use the theoretically most appealing VC generation algorithm. This is often not the case. The most theoretically appealing algorithms are based upon weakest ...
متن کاملUsing Weakest Preconditions to Simplify Integrity Constraint Checking
We present a procedure for deriving the weakest precondition for a database update and an integrity constraint. We show how to simplify the weakest precondition to produce a condition to be evaluated before the update is performed. This provides an efficient means to ensure that database updates maintain integrity constraints.
متن کاملSimple characterizations for commutativity of quantum weakest preconditions
In a recent letter by Ying et al. [Inf. Process. Lett. 104 (2007) 152-158], it showed some sufficient conditions for commutativity of quantum weakest preconditions. This paper provides some simple characterizations for the commutativity of quantum weakest preconditions, i.e., Theorem 3, Theorem 4 and Proposition 5 in what follows. We also show that to characterize the commutativity of quantum w...
متن کاملQuantum weakest preconditions
We develop a notion of predicate transformer and, in particular, the weakest precondition, appropriate for quantum computation. We show that there is a Stone-type duality between the usual state-transformer semantics and the weakest precondition semantics. Rather than trying to reduce quantum computation to probabilistic programming we develop a notion that is directly taken from concepts used ...
متن کاملCommutativity of quantum weakest preconditions
The notion of quantum weakest precondition was introduced by D’Hondt and P. Panangaden (Mathematical Structures in Computer Science 16(2006)429-451), and they presented a representation of weakest precondition of a quantum program in the operatorsum form. In this letter, we give an intrinsic characterization of the weakest precondition of a quantum program given in a systemenvironment model. Fu...
متن کامل